<?php
class AuthControl extends Control{
	//初始化
	public function __init() {

	}
	public function success($msg="操作成功",$url=NULL,$time=2,$tpl=null) {
		if(IS_AJAX) {
			$this->ajax(array("state"=>1,'message'=>$msg));
		} else {
			parent::success($msg,$url,$time,$tpl);
		}
	}
	public function error($msg="操作失败",$url=NULL,$time=2,$tpl=null) {
		if(IS_AJAX) {
			$this->ajax(array("state"=>0,'message'=>$msg));
		} else {
			parent::error($msg,$url,$time,$tpl);
		}
	}
}